﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_RptBangTinhKhauHao : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CboDonVi")]
        private ComboBox _CboDonVi;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("OptAll")]
        private RadioButton _OptAll;
        [AccessedThroughProperty("OptFilter")]
        private RadioButton _OptFilter;
        [AccessedThroughProperty("updNam")]
        private NumericUpDown _updNam;
        [AccessedThroughProperty("updThang")]
        private NumericUpDown _updThang;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private clsTaiSanCoDinh objTS;

        public Frm_RptBangTinhKhauHao()
        {
            base.Load += new EventHandler(this.Frm_RptBangTinhKhauHao_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objTS = new clsTaiSanCoDinh();
            this.InitializeComponent();
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            this.PrintReport();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_RptBangTinhKhauHao_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                BuildComboModule.BuildCombo(this.CboDonVi, modGeneral.ListDanhMuc.DonVi, true, "", "");
                this.CboDonVi.SelectedValue = modGeneral.H_CLIENT;
                this.updThang.Value = new decimal(DateAndTime.Today.Month);
                this.updNam.Value = new decimal(DateAndTime.Today.Year);
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_RptBangTinhKhauHao));
            this.CboDonVi = new ComboBox();
            this.CmdCancel = new Button();
            this.Label2 = new Label();
            this.CmdOK = new Button();
            this.GroupBox1 = new GroupBox();
            this.Label1 = new Label();
            this.updNam = new NumericUpDown();
            this.Label3 = new Label();
            this.updThang = new NumericUpDown();
            this.OptAll = new RadioButton();
            this.OptFilter = new RadioButton();
            this.GroupBox1.SuspendLayout();
            this.updNam.BeginInit();
            this.updThang.BeginInit();
            this.SuspendLayout();
            this.CboDonVi.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboDonVi.Enabled = false;
            this.CboDonVi.FormattingEnabled = true;
            Point point = new Point(0x65, 0x1b);
            this.CboDonVi.Location = point;
            this.CboDonVi.Name = "CboDonVi";
            Size size = new Size(0x11c, 0x15);
            this.CboDonVi.Size = size;
            this.CboDonVi.TabIndex = 0x84;
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x147, 0x88);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x4f, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 11;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.Label2.AutoSize = true;
            point = new Point(0x27, 30);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x26, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x83;
            this.Label2.Text = "Đơn vị";
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0xf5, 0x88);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x4e, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 10;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.GroupBox1.Controls.Add(this.OptAll);
            this.GroupBox1.Controls.Add(this.Label1);
            this.GroupBox1.Controls.Add(this.updNam);
            this.GroupBox1.Controls.Add(this.Label3);
            this.GroupBox1.Controls.Add(this.updThang);
            this.GroupBox1.Controls.Add(this.CboDonVi);
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.OptFilter);
            point = new Point(5, 6);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            size = new Size(0x191, 0x7c);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 9;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "T\x00f9y chọn";
            this.Label1.AutoSize = true;
            point = new Point(0xa4, 0x3f);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x1d, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x88;
            this.Label1.Text = "Năm";
            point = new Point(0xd1, 0x3d);
            this.updNam.Location = point;
            decimal num = new decimal(new int[] { 0x9c4, 0, 0, 0 });
            this.updNam.Maximum = num;
            num = new decimal(new int[] { 0x7d0, 0, 0, 0 });
            this.updNam.Minimum = num;
            this.updNam.Name = "updNam";
            size = new Size(0x3a, 20);
            this.updNam.Size = size;
            this.updNam.TabIndex = 0x87;
            num = new decimal(new int[] { 0x7d0, 0, 0, 0 });
            this.updNam.Value = num;
            this.Label3.AutoSize = true;
            point = new Point(0x27, 0x3f);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x26, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x86;
            this.Label3.Text = "Th\x00e1ng";
            point = new Point(0x65, 60);
            this.updThang.Location = point;
            num = new decimal(new int[] { 12, 0, 0, 0 });
            this.updThang.Maximum = num;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.updThang.Minimum = num;
            this.updThang.Name = "updThang";
            size = new Size(0x2d, 20);
            this.updThang.Size = size;
            this.updThang.TabIndex = 0x85;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.updThang.Value = num;
            this.OptAll.AutoSize = true;
            this.OptAll.Checked = true;
            point = new Point(0x65, 0x59);
            this.OptAll.Location = point;
            this.OptAll.Name = "OptAll";
            size = new Size(0x62, 0x11);
            this.OptAll.Size = size;
            this.OptAll.TabIndex = 0x89;
            this.OptAll.TabStop = true;
            this.OptAll.Text = "In tất cả t\x00e0i sản";
            this.OptAll.UseVisualStyleBackColor = true;
            this.OptFilter.AutoSize = true;
            point = new Point(0xd1, 0x59);
            this.OptFilter.Location = point;
            this.OptFilter.Name = "OptFilter";
            size = new Size(0x9e, 0x11);
            this.OptFilter.Size = size;
            this.OptFilter.TabIndex = 0x8a;
            this.OptFilter.Text = "T\x00e0i sản khấu h\x00e0o th\x00e1ng n\x00e0y";
            this.OptFilter.UseVisualStyleBackColor = true;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x19b, 0xa6);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.CmdOK);
            this.Controls.Add(this.GroupBox1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_RptBangTinhKhauHao";
            this.ShowIcon = false;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-0012";
            this.Text = "BANG TINH KHAU HAO";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.updNam.EndInit();
            this.updThang.EndInit();
            this.ResumeLayout(false);
        }

        public void PrintReport()
        {
            this.Cursor = Cursors.WaitCursor;
            string strNamThang = "";
            int intIn = 0;
            strNamThang = this.updNam.Value.ToString() + LVYModule.sRight("00" + Conversions.ToString(this.updThang.Value), 2);
            if (this.OptAll.Checked)
            {
                intIn = 0;
            }
            else
            {
                intIn = 1;
            }
            DataTable dataTable = this.objTS.GetDataBangTinhKhauHao(strNamThang, Conversions.ToString(this.CboDonVi.SelectedValue), intIn);
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else if (dataTable != null)
            {
                Rpt_BanTinhKhauHao hao = new Rpt_BanTinhKhauHao();
                try
                {
                    hao.SetDataSource(dataTable);
                    hao.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        hao.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        hao.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    hao.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    hao.SetParameterValue(2, modGeneral.Tranlated("T\x00e0i khoản", "") + ": " + modGeneral.H_ACCOUNTNAME + " " + modGeneral.Tranlated("Tại", "") + ":" + modGeneral.H_BANK);
                    hao.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    hao.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    hao.SetParameterValue(5, modGeneral.Tranlated("BẢNG T\x00cdNH KHẤU HAO T\x00c0I SẢN CỐ ĐỊNH", ""));
                    hao.SetParameterValue(6, modGeneral.Tranlated("Th\x00e1ng", "") + " : " + LVYModule.sRight("00" + this.updThang.Value.ToString(), 2) + "/" + this.updNam.Value.ToString());
                    hao.SetParameterValue(7, modGeneral.Tranlated("STT", ""));
                    hao.SetParameterValue(8, modGeneral.Tranlated("M\x00e3 t\x00e0i sản", ""));
                    hao.SetParameterValue(9, modGeneral.Tranlated("T\x00ean t\x00e0i sản", ""));
                    hao.SetParameterValue(10, modGeneral.Tranlated("Ng\x00e0y đưa v\x00e0o sử dụng", ""));
                    hao.SetParameterValue(11, modGeneral.Tranlated("T\x00e0i sản cố định đầu kỳ", ""));
                    hao.SetParameterValue(12, modGeneral.Tranlated("T\x00e0i sản cố định cuối kỳ", ""));
                    hao.SetParameterValue(13, modGeneral.Tranlated("Nguy\x00ean gi\x00e1", ""));
                    hao.SetParameterValue(14, modGeneral.Tranlated("Hao m\x00f2n lũy kế", ""));
                    hao.SetParameterValue(15, modGeneral.Tranlated("Gi\x00e1 trị c\x00f2n lại", ""));
                    hao.SetParameterValue(0x10, modGeneral.Tranlated("Số th\x00e1ng khấu hao", ""));
                    hao.SetParameterValue(0x11, modGeneral.Tranlated("Khấu hao trong kỳ", ""));
                    hao.SetParameterValue(0x12, modGeneral.Tranlated("Tổng cộng", ""));
                    hao.SetParameterValue(0x13, modGeneral.Tranlated("Ng\x00e0y ...... th\x00e1ng ...... năm ...............", ""));
                    hao.SetParameterValue(20, modGeneral.Tranlated("Lập biểu", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hao;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    this.Cursor = Cursors.Default;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        internal virtual ComboBox CboDonVi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboDonVi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboDonVi = value;
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual RadioButton OptAll
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OptAll;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._OptAll = value;
            }
        }

        internal virtual RadioButton OptFilter
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OptFilter;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._OptFilter = value;
            }
        }

        internal virtual NumericUpDown updNam
        {
            [DebuggerNonUserCode]
            get
            {
                return this._updNam;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._updNam = value;
            }
        }

        internal virtual NumericUpDown updThang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._updThang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._updThang = value;
            }
        }
    }
}

